package com.shop.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * <p>
 * 轮播图 
 * </p>
 *
 * @author Administrator
 * @since 2020-10-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("carousel")
public class Carousel implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = ID, type = IdType.INPUT)
    private String id;

    /**
     * 图片 图片地址
     */
    @TableField(IMAGE_URL)
    private String imageUrl;

    /**
     * 背景色
     */
    @TableField(BACKGROUND_COLOR)
    private String backgroundColor;

    /**
     * 商品id 商品id
     */
    @TableField(ITEM_ID)
    private String itemId;

    /**
     * 商品分类id 商品分类id
     */
    @TableField(CAT_ID)
    private String catId;

    /**
     * 轮播图类型 轮播图类型，用于判断，可以根据商品id或者分类进行页面跳转，1：商品 2：分类
     */
    @TableField(TYPE)
    private Integer type;

    /**
     * 轮播图展示顺序
     */
    @TableField(SORT)
    private Integer sort;

    /**
     * 是否展示
     */
    @TableField(IS_SHOW)
    private Integer isShow;

    /**
     * 创建时间 创建时间
     */
    @TableField(CREATE_TIME)
    private Date createTime;

    /**
     * 更新时间 更新
     */
    @TableField(UPDATE_TIME)
    private Date updateTime;


    public static final String ID = "`id`";

    public static final String IMAGE_URL = "`image_url`";

    public static final String BACKGROUND_COLOR = "`background_color`";

    public static final String ITEM_ID = "`item_id`";

    public static final String CAT_ID = "`cat_id`";

    public static final String TYPE = "`type`";

    public static final String SORT = "`sort`";

    public static final String IS_SHOW = "`is_show`";

    public static final String CREATE_TIME = "`create_time`";

    public static final String UPDATE_TIME = "`update_time`";


    public static final String ID_COMMENT = "主键";

    public static final String IMAGE_URL_COMMENT = "图片 图片地址";

    public static final String BACKGROUND_COLOR_COMMENT = "背景色";

    public static final String ITEM_ID_COMMENT = "商品id 商品id";

    public static final String CAT_ID_COMMENT = "商品分类id 商品分类id";

    public static final String TYPE_COMMENT = "轮播图类型 轮播图类型，用于判断，可以根据商品id或者分类进行页面跳转，1：商品 2：分类";

    public static final String SORT_COMMENT = "轮播图展示顺序";

    public static final String IS_SHOW_COMMENT = "是否展示";

    public static final String CREATE_TIME_COMMENT = "创建时间 创建时间";

    public static final String UPDATE_TIME_COMMENT = "更新时间 更新";



    public static Carousel of(Object obj) {
        Carousel e = new Carousel();
        BeanUtils.copyProperties(obj, e);
        return e;
    }

    public static QueryWrapper<Carousel> queryWrapper(Object obj) {
        return new QueryWrapper<>(of(obj));
    }

}
